package com.bdqn.springbootmybatisplus.config;

import com.bdqn.springbootmybatisplus.web.AuthorizationFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;

/**
 * FilterConfig
 *
 * @author LILIBO
 * @since 2021-11-29
 */
// @Configuration
public class FilterConfig {

    /**
     * 配置过滤规则
     */
    // @Bean
    public FilterRegistrationBean filterRegist() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new AuthorizationFilter());
        registration.setName("AuthorizationFilter");
        registration.addUrlPatterns("/main"); // 作为演示，仅仅只限制/main访问
        registration.setOrder(5);
        return registration;
 }
}
